package com.hww.lcnclient.service;

import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.hww.lcnclient.dao.UserMapper;
import com.hww.lcnclient.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author: Wenwu Huang
 * @Date: 2019/4/29 11:05
 */
@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    @Autowired
    private ServiceB serviceB;

    @LcnTransaction
    @Transactional
    public void save() {
//        serviceB.save();

        User user = new User();
        user.setName("a");
        user.setAge(1);
        userMapper.insert(user);
    }

}
